<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>RTF::Writer - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of RTF-Writer - MetaCPAN" href="https://metacpan.org/dist/RTF-Writer/releases.rss" />
        <link rel="canonical" href="./RTF::Writer.html" />
        <meta name="description" content="a lame sample program for outputting RTF" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/RTF::Writer" />
<meta name="twitter:title"       content="RTF::Writer" />
<meta name="twitter:description" content="" />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="./RTF::Writer.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of RTF-Writer was released.">
      <span class="relatize">04 Nov 2003 11:24:02 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/RTF-Writer">RTF-Writer</a>
  </li>
  <li>
    Module version: 1.11
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/RTF-Writer/source/lib/RTF/Writer.pm">Source</a>
    (<a href="https://metacpan.org/dist/RTF-Writer/source/lib/RTF/Writer.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g p" href="https://metacpan.org/dist/RTF-Writer/source/lib/RTF/Writer.pod">Pod Source</a>
    (<a href="https://metacpan.org/dist/RTF-Writer/source/lib/RTF/Writer.pod?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/RTF-Writer/source/lib/RTF">Browse</a>
    (<a href="https://metacpan.org/dist/RTF-Writer/source/lib/RTF?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/RTF-Writer/changes">Changes</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/RTF-Writer/contribute">How to Contribute</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://rt.cpan.org/Public/Dist/Display.html?Name=RTF-Writer">Issues</a>
      (5)
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=RTF-Writer+1.11" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/R/RTF-Writer.html?oncpan=1&amp;distmat=1&amp;version=1.11&amp;grade=2" style="color: #090">1257</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/R/RTF-Writer.html?oncpan=1&amp;distmat=1&amp;version=1.11&amp;grade=3" style="color: #900">0</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/R/RTF-Writer.html?oncpan=1&amp;distmat=1&amp;version=1.11&amp;grade=4">0</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/SBURKE/RTF-Writer-1.11">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on RTF-Writer who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 0
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/RTF-Writer-1.11/index.html">56.70% Coverage </a>
    </li>
    <li>
      License: unknown
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/RTF-Writer/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/S/SB/SBURKE/RTF-Writer-1.11.tar.gz">
      Download (<span itemprop="fileSize">56.38KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FSBURKE%2FRTF-Writer-1.11%2Flib%2FRTF%2FWriter.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/RTF-Writer/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/RTF-Writer/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:RTF-Writer">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="RTF-Writer">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/RTF/Writer.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="SBURKE/RTF-Writer-1.11"
>1.11
  (SBURKE on 2003-11-04)</option>
<optgroup label="BackPAN">'
<option
  
  value="SBURKE/RTF-Writer-1.10"
>1.10
  (SBURKE on 2003-10-15)</option>
<option
  
  value="SBURKE/RTF-Writer-1.09"
>1.09
  (SBURKE on 2003-09-26)</option>
<option
  
  value="SBURKE/RTF-Writer-1.08"
>1.08
  (SBURKE on 2003-09-24)</option>
<option
  
  value="SBURKE/RTF-Writer-1.07"
>1.07
  (SBURKE on 2002-12-08)</option>
<option
  
  value="SBURKE/RTF-Writer-1.06"
>1.06
  (SBURKE on 2001-07-27)</option>
<option
  
  value="SBURKE/RTF-Writer-1.05"
>1.05
  (SBURKE on 2001-06-22)</option>
<option
  
  value="SBURKE/RTF-Writer-1.04"
>1.04
  (SBURKE on 2001-05-28)</option>
<option
  
  value="SBURKE/RTF-Writer-1.03"
>1.03
  (SBURKE on 2001-05-17)</option>
<option
  
  value="SBURKE/RTF-Writer-1.02"
>1.02
  (SBURKE on 2001-04-26)</option>
<option
  
  value="SBURKE/RTF-Writer-1.01"
>1.01
  (SBURKE on 2001-04-24)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/SBURKE/RTF-Writer-1.11/diff/' + encodeURIComponent(this.value) + '/lib/RTF/Writer.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="SBURKE/RTF-Writer-1.11"
>1.11
  (SBURKE on 2003-11-04)</option>
<optgroup label="BackPAN">'
<option
  
  value="SBURKE/RTF-Writer-1.10"
>1.10
  (SBURKE on 2003-10-15)</option>
<option
  
  value="SBURKE/RTF-Writer-1.09"
>1.09
  (SBURKE on 2003-09-26)</option>
<option
  
  value="SBURKE/RTF-Writer-1.08"
>1.08
  (SBURKE on 2003-09-24)</option>
<option
  
  value="SBURKE/RTF-Writer-1.07"
>1.07
  (SBURKE on 2002-12-08)</option>
<option
  
  value="SBURKE/RTF-Writer-1.06"
>1.06
  (SBURKE on 2001-07-27)</option>
<option
  
  value="SBURKE/RTF-Writer-1.05"
>1.05
  (SBURKE on 2001-06-22)</option>
<option
  
  value="SBURKE/RTF-Writer-1.04"
>1.04
  (SBURKE on 2001-05-28)</option>
<option
  
  value="SBURKE/RTF-Writer-1.03"
>1.03
  (SBURKE on 2001-05-17)</option>
<option
  
  value="SBURKE/RTF-Writer-1.02"
>1.02
  (SBURKE on 2001-04-26)</option>
<option
  
  value="SBURKE/RTF-Writer-1.01"
>1.01
  (SBURKE on 2001-04-24)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><a href="https://metacpan.org/pod/Carp" title="Carp" class="ellipsis">Carp</a></li>
  <li><a href="https://metacpan.org/pod/Exporter" title="Exporter" class="ellipsis">Exporter</a></li>
  <li><a href="https://metacpan.org/pod/File::Path" title="File::Path" class="ellipsis">File::Path</a></li>
  <li><a href="https://metacpan.org/pod/Image::Size" title="Image::Size" class="ellipsis">Image::Size</a></li>
  <li><a href="https://metacpan.org/pod/UNIVERSAL" title="UNIVERSAL" class="ellipsis">UNIVERSAL</a></li>
  <li><a href="https://metacpan.org/pod/strict" title="strict" class="ellipsis">strict</a></li>
  <li><i class="ttip" title="dynamic_config enabled">and possibly others</i></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/RTF::Writer/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=RTF%3A%3AWriter">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=RTF-Writer">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/SBURKE/RTF-Writer-1.11/view/lib/RTF/Writer.pm">This version</a>
    </li>
    <li>
      <a href="./RTF::Writer.html">Latest version</a>
    </li>
    <li>
    </li>
    <li>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/SBURKE" class="author-name">Sean M. Burke</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/RTF/Writer.pm&#39;" class="">
<option
  selected
  value="SBURKE/RTF-Writer-1.11"
>1.11
  (SBURKE on 2003-11-04)</option>
<optgroup label="BackPAN">'
<option
  
  value="SBURKE/RTF-Writer-1.10"
>1.10
  (SBURKE on 2003-10-15)</option>
<option
  
  value="SBURKE/RTF-Writer-1.09"
>1.09
  (SBURKE on 2003-09-26)</option>
<option
  
  value="SBURKE/RTF-Writer-1.08"
>1.08
  (SBURKE on 2003-09-24)</option>
<option
  
  value="SBURKE/RTF-Writer-1.07"
>1.07
  (SBURKE on 2002-12-08)</option>
<option
  
  value="SBURKE/RTF-Writer-1.06"
>1.06
  (SBURKE on 2001-07-27)</option>
<option
  
  value="SBURKE/RTF-Writer-1.05"
>1.05
  (SBURKE on 2001-06-22)</option>
<option
  
  value="SBURKE/RTF-Writer-1.04"
>1.04
  (SBURKE on 2001-05-28)</option>
<option
  
  value="SBURKE/RTF-Writer-1.03"
>1.03
  (SBURKE on 2001-05-17)</option>
<option
  
  value="SBURKE/RTF-Writer-1.02"
>1.02
  (SBURKE on 2001-04-26)</option>
<option
  
  value="SBURKE/RTF-Writer-1.01"
>1.01
  (SBURKE on 2001-04-24)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/RTF-Writer">RTF-Writer-1.11</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage one &#10;
          • 1 direct dependent &#10;          • 1 total dependent
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="10"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="15"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="RTF-Writer-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="RTF-Writer-1.11">
    <input type="hidden" name="author" value="SBURKE">
    <input type="hidden" name="distribution" value="RTF-Writer">
    <button type="submit" class="favorite"><span></span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="./RTF::Writer.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite">
<span></span> ++</a>
</div>
   / <span>RTF::Writer</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="./RTF::Writer.html#NAME">NAME</a></li>
  <li><a href="./RTF::Writer.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="./RTF::Writer.html#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="./RTF::Writer.html#METHODS">METHODS</a></li>
  <li><a href="./RTF::Writer.html#AUTOMETHODS">AUTOMETHODS</a></li>
  <li><a href="./RTF::Writer.html#FUNCTIONS">FUNCTIONS</a>
    <ul>
      <li><a href="./RTF::Writer.html#Cell-Alignment-Syntax">Cell Alignment Syntax</a></li>
      <li><a href="./RTF::Writer.html#Cell-Border-Syntax">Cell Border Syntax</a></li>
      <li><a href="./RTF::Writer.html#Cell-Border-Syntax,-Formally">Cell Border Syntax, Formally</a></li>
    </ul>
  </li>
  <li><a href="./RTF::Writer.html#SEE-ALSO">SEE ALSO</a></li>
  <li><a href="./RTF::Writer.html#COPYRIGHT-AND-DISCLAIMER">COPYRIGHT AND DISCLAIMER</a></li>
  <li><a href="./RTF::Writer.html#AUTHOR">AUTHOR</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>RTF::Writer - for generating documents in Rich Text Format</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code>  use RTF::Writer;
  my $rtf = RTF::Writer-&gt;new_to_file(&quot;greetings.rtf&quot;);
  $rtf-&gt;prolog( &#39;title&#39; =&gt; &quot;Greetings, hyoomon&quot; );
  $rtf-&gt;number_pages;
  $rtf-&gt;paragraph(
    \&#39;\fs40\b\i&#39;,  # 20pt, bold, italic
    &quot;Hi there!&quot;
  );
  $rtf-&gt;close;</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>This module is for generating documents in Rich Text Format.</p>

<p>This module is a class; an object belonging to this class acts like an output filehandle, and calling methods on it causes RTF text to be written.</p>

<p>Incidentally, this module also exports a few useful functions, upon request.</p>

<p>The following documentation assumes some familiarity with the RTF Specification. Users not already intimately familiar with RTF should look at <a href="https://metacpan.org/pod/RTF::Cookbook">RTF::Cookbook</a> and/or my book <i>RTF Pocket Guide</i> from O&#39;Reilly, <a href="http://www.oreilly.com/catalog/rtfpg/">http://www.oreilly.com/catalog/rtfpg/</a></p>

<h1 id="METHODS">METHODS</h1>

<dl>

<dt id="$h-=-RTF::Writer-&gt;new_to_file($filename);"><a id="h---RTF::Writer--new_to_file-filename"></a>$h = RTF::Writer-&gt;new_to_file($filename);</dt>
<dd>

<p>This creates a new RTF output stream object, such that sending text to this object will write to the filespec given. This is basically a wrapper around new_to_handle. If opening a write-handle to $filename fails (or if $filename is undef or zero-length), then a fatal error results.</p>

</dd>
<dt id="$h-=-RTF::Writer-&gt;new_to_handle(*FILEHANDLE);"><a id="h---RTF::Writer--new_to_handle-FILEHANDLE"></a>$h = RTF::Writer-&gt;new_to_handle(*FILEHANDLE);</dt>
<dd>

<p>This creates a new RTF output stream object, such that sending text to this object will write to the filehandle given. The filehandle can be a glob (*FH) or a filehandle object (*FH{IO} or the value from <code>IO::File-&gt;new(...)</code>).</p>

</dd>
<dt id="$h-=-RTF::Writer-&gt;new_to_string(\$string);"><a id="h---RTF::Writer--new_to_string-string"></a>$h = RTF::Writer-&gt;new_to_string(\$string);</dt>
<dd>

<p>This creates a new RTF output stream object, such that sending text to this object will append to the string that you&#39;ve passed a reference to.</p>

</dd>
<dt id="$h-&gt;print(...);"><a id="h--print"></a>$h-&gt;print(...);</dt>
<dd>

<p>This is the basic method for writing text to an RTF stream. This takes a list of items. Each item is either:</p>

<dl>

<dt id="a-plain-string,-like-&quot;foo\n&quot;"><a id="a"></a><a id="a-plain-string--like--foo-n"></a>a plain string, like &quot;foo\n&quot;</dt>
<dd>

<p>In this case, the value is imputed to be a plaintext string, and an rtf-escaped version of it is written. For example <code>&quot;Stuff\n\t\tUmmm\n&quot;</code> causes <code>&#39;Stuff\line \tab \tab Umm\line &#39;</code> to be written. See <code>rtfesc(x)</code> for further details of escaping.</p>

</dd>
<dt id="a-scalar-reference,-like-\&#39;\ul&#39;"><a id="a1"></a><a id="a-scalar-reference--like--ul"></a>a scalar-reference, like \&#39;\ul&#39;</dt>
<dd>

<p>In this case, the value is imputed to be a reference to <i>already escaped</i> text. This is the basic way to emit RTF codes. Text passed this way will be written without any additional escaping.</p>

<p>Unless $RTF::Writer::AUTO_NL (normally on) has been turned off, the item written will be followed with a (presumably harmless) newline character to delimit any code in there from any following text, <i>if</i> the last character of this string is a digit or a lowercase letter. This is so that <code>(\&#39;\i&#39;, &quot;foo!&quot;)</code> emits <code>\i[newline]foo!&#39;</code> (which does what you expected), instead of <code>&#39;\ifoo!&#39;</code>, which looks like an RTF command &quot;ifoo&quot; followed by a plaintext &quot;!&quot;.</p>

</dd>
<dt id="an-array-reference,-like-[-\&#39;\ul&#39;,-&#39;foo&#39;-]"><a id="an"></a><a id="an-array-reference--like----ul---foo"></a>an array-reference, like [ \&#39;\ul&#39;, &#39;foo&#39; ]</dt>
<dd>

<p>This emits an open-brace &quot;{&quot;, as RTF uses for opening &quot;groups&quot; (generally for delimiting the effects of character-formatting commands like &#39;\ul&#39;, or a few formatting commands like &#39;\footnote&#39;); then it emits the items in the referred-to array; and then emits a closing &quot;}&quot;. I intend this to be useful is making sure that you don&#39;t emit more open-braces than close-braces, since that usually makes RTF readers immediately reject such a file.</p>

<p>You can nest these array-references, like:</p>

<pre><code>     $h-&gt;print(
       \&#39;\col2&#39;,
       [ \&#39;\pard&#39;,
         &quot;It is now &quot;,
         [ \&#39;\f1&#39;,
           scalar(localtime), &quot; local, or &quot;,
           scalar(gmtime), &quot; GMT.&quot;,
         ],
         &quot; -- if you&#39;re &quot;,
         [ \&#39;\i&#39;,
           &quot;keeping track.&quot;,
         ],
       ],
       \&#39;\par\page&#39;,
     );</code></pre>

</dd>
</dl>

<p>The return value of the print() method is currently always the value 1, although this may change.</p>

</dd>
<dt id="$h-&gt;prolog(...);"><a id="h--prolog"></a>$h-&gt;prolog(...);</dt>
<dd>

<p>This writes an RTF prolog to $h. You are free to make your own prolog using just $h-&gt;print(\&#39;...your own code...&#39;), but I find in easier to automate this task, particularly with some sane defaults.</p>

<p>Since emitting a prolog opens a &quot;{&quot;-group, calling $h-&gt;prolog(...) sets a flag in $h so that when you call $h-&gt;close(), a closing &quot;}&quot; will automatically be written before the stream object is actually closed.</p>

<p>The options to the prolog() method are passed as a list of keys and values, for controlling the contents of the prolog written. The options are listed below, roughly with the most important options first.</p>

<p>(Be careful with the spelling of these options. Some are rather odd, because they are (mostly) based on the name of the relevent RTF command, and a systematic naming scheme for commands is one thing you won&#39;t find in RTF!)</p>

<dl>

<dt id="&#39;fonts&#39;-=&gt;-[-&quot;Courier-New&quot;,-&quot;Georgia&quot;,-&quot;Whatever&quot;...],"><a id="fonts-------Courier-New---Georgia---Whatever"></a>&#39;fonts&#39; =&gt; [ &quot;Courier New&quot;, &quot;Georgia&quot;, &quot;Whatever&quot;...],</dt>
<dd>

<p>This value is for the font table section of the prolog. If the value is an arrayref, then it should be a reference to an array whose items should be either plain text strings, like &quot;Times Roman&quot;, which are the (unescaped) names of fonts; or the items in the array can be scalar-refs, for expressing RTF control words along with the (escaped) font name, as in <code>\&#39;\froman Times New Roman&#39;</code>. If the value of the &quot;fonts&quot; parameters is a scalar ref, then it is taken to be a reference to code of your own that expresses the whole font table. If you don&#39;t specify a value for the &quot;font&quot; option, then you get a font table with one entry, &quot;Times New Roman&quot;.</p>

<p>You should be sure to declare all fonts that you switch to in your document (as with \&#39;\f3&#39;, to change the current font to what&#39;s declared in entry 3 (counting from 0) in the font table).</p>

</dd>
<dt id="&#39;deff&#39;-=&gt;-INTEGER,"><a id="deff----INTEGER"></a>&#39;deff&#39; =&gt; INTEGER,</dt>
<dd>

<p>This is for expressing, in the prolog, the font-table number of the default font for this document. The default is 0, which is an often useful value.</p>

</dd>
<dt id="&#39;colors&#39;-=&gt;-[-undef,-[0,142,252],-[200,32,0],-...],"><a id="colors------undef---0-142-252---200-32-0"></a>&#39;colors&#39; =&gt; [ undef, [0,142,252], [200,32,0], ...],</dt>
<dd>

<p>This value is for expressing the document&#39;s (generally optional) color table. If you stipulate an arrayref value, then each item of the array should be either an RGB triplet expressed as an arrayref like [200,32,0], or undef, for a null color-entry. If you stipulate a scalar-ref value for &#39;colors&#39;, then it is taken to be a reference to code of your own that expresses the whole font table.</p>

<p>If you don&#39;t stipulate any value for &#39;colors&#39;, then you get a table consisting of three colors: null/default (undef), 100% red ([2550,0,0]), and 100% blue ([0,0,255]).</p>

<p>You can freely ignore concerns of color tables if you don&#39;t use color-changing codes in your document (like \&#39;\cf2&#39;, to switch the text foreground color to what&#39;s declared at entry 2 (starting from 0) in the color table).</p>

</dd>
<dt id="&#39;stylesheet&#39;-=&gt;-STRING,"><a id="stylesheet----STRING"></a>&#39;stylesheet&#39; =&gt; STRING,</dt>
<dd>

</dd>
<dt id="&#39;filetbl&#39;-=&gt;-STRING,"><a id="filetbl----STRING"></a>&#39;filetbl&#39; =&gt; STRING,</dt>
<dd>

</dd>
<dt id="&#39;listtables&#39;-=&gt;-STRING,"><a id="listtables----STRING"></a>&#39;listtables&#39; =&gt; STRING,</dt>
<dd>

</dd>
<dt id="&#39;revtbl&#39;-=&gt;-STRING,"><a id="revtbl----STRING"></a>&#39;revtbl&#39; =&gt; STRING,</dt>
<dd>

<p>These are for expressing, in the prolog, code constituting the document&#39;s style sheet, table-of-files, table-of-lists, and table-of-revisions, respectively. The default value of each of these is empty-string. None of these are needed by a typical RTF document.</p>

</dd>
<dt id="&#39;more_default&#39;-=&gt;-STRING,"><a id="more_default----STRING"></a>&#39;more_default&#39; =&gt; STRING,</dt>
<dd>

<p>This is for inserting any additional code just after the &#39;\deffN&#39; in the start of the prolog, before the font table. A common useful value here is \&#39;\deflang1033&#39;, to express the default language (1033 = RTFese for US English) for the document, although my reading of the RTF spec leads me to believe that this doesn&#39;t need to be in the prolog here (where many writers put it, as apparently accepted by many RTF readers), but should (instead?) go just after the prolog, with other &quot;document formatting&quot; commands described in the &quot;Document Formatting Properties&quot; section of the RTF Specification.</p>

</dd>
<dt id="&#39;doccomm&#39;-=&gt;-STRING,"><a id="doccomm----STRING"></a>&#39;doccomm&#39; =&gt; STRING,</dt>
<dd>

<p>This value is for the &quot;document comment&quot; metainformation item in the prolog, which appears as the &quot;Comment&quot; field in the &quot;File Properties&quot; panel in MSWord, or as the &quot;Abstract&quot; field in the &quot;File Properties&quot; window in WordPerfect.</p>

<p>If no value is specified, then RTF::Writer puts a string noting the value of <code>$0</code> (typically the filespec to the current Perl program), and the version of RTF::Writer used.</p>

</dd>
<dt id="&#39;title&#39;-=&gt;-STRING,"><a id="title----STRING"></a>&#39;title&#39; =&gt; STRING,</dt>
<dd>

</dd>
<dt id="&#39;subject&#39;-=&gt;-STRING,"><a id="subject----STRING"></a>&#39;subject&#39; =&gt; STRING,</dt>
<dd>

</dd>
<dt id="&#39;author&#39;-=&gt;-STRING,"><a id="author----STRING"></a>&#39;author&#39; =&gt; STRING,</dt>
<dd>

</dd>
<dt id="&#39;manager&#39;-=&gt;-STRING,"><a id="manager----STRING"></a>&#39;manager&#39; =&gt; STRING,</dt>
<dd>

</dd>
<dt id="&#39;company&#39;-=&gt;-STRING,"><a id="company----STRING"></a>&#39;company&#39; =&gt; STRING,</dt>
<dd>

</dd>
<dt id="&#39;operator&#39;-=&gt;-STRING,"><a id="operator----STRING"></a>&#39;operator&#39; =&gt; STRING,</dt>
<dd>

</dd>
<dt id="&#39;category&#39;-=&gt;-STRING,"><a id="category----STRING"></a>&#39;category&#39; =&gt; STRING,</dt>
<dd>

</dd>
<dt id="&#39;keywords&#39;-=&gt;-STRING,"><a id="keywords----STRING"></a>&#39;keywords&#39; =&gt; STRING,</dt>
<dd>

</dd>
<dt id="&#39;hlinkbase&#39;-=&gt;-STRING,"><a id="hlinkbase----STRING"></a>&#39;hlinkbase&#39; =&gt; STRING,</dt>
<dd>

</dd>
<dt id="&#39;comment&#39;-=&gt;-STRING,"><a id="comment----STRING"></a>&#39;comment&#39; =&gt; STRING,</dt>
<dd>

<p>These are for stipulating the string values of these various optional document metainformation items. &#39;operator&#39; is for the name of the person who last made changes to the document; &#39;hlinkbase&#39; is which is the URL or path that is used for for resolving any all relative hyperlinks in the document; &#39;comment&#39; is reportedly just ignored (cf. the &#39;doccomm&#39; attribute, which is <i>not</i> ignored); and you can guess the rest.</p>

<p>The meanings of all of these are explained in greater detail in the RTF spec.</p>

</dd>
<dt id="&#39;revtim&#39;-=&gt;-EPOCH_NUMBER,"><a id="revtim----EPOCH_NUMBER"></a>&#39;revtim&#39; =&gt; EPOCH_NUMBER,</dt>
<dd>

<p>This value is for the document metainformation section of the prolog. It signifies the last-modified time of the document. EPOCH_NUMBER is the number of seconds since the epoch, such as one gets from <code>(stat($thing)[9])</code> or <code>time()</code>; or you may pass a reference a timelist, like [localtime($whatever)].</p>

<p>If no defined value for revtime is stipulated in the call to prolog(...) then the current value of time() is used. Explicitly pass a value of undef to suppress emitting any &#39;creatim&#39; value.</p>

</dd>
<dt id="&#39;creatim&#39;-=&gt;-EPOCH_NUMBER,"><a id="creatim----EPOCH_NUMBER"></a>&#39;creatim&#39; =&gt; EPOCH_NUMBER,</dt>
<dd>

<p>This value is for the document metainformation section of the prolog. It signifies the last-modified time of the document. If no defined value for &#39;creatim&#39; is stipulated in the call to prolog(...) then the current value of time() is used. Explicitly pass a value of undef to suppress emitting any &#39;creatim&#39; value.</p>

</dd>
<dt id="&#39;printim&#39;-=&gt;-EPOCH_NUMBER,"><a id="printim----EPOCH_NUMBER"></a>&#39;printim&#39; =&gt; EPOCH_NUMBER,</dt>
<dd>

<p>This value is for the document metainformation section of the prolog. It signifies the time when this document was last printed. If you don&#39;t stipulate a defined value here, no &#39;printim&#39; metainformation is written.</p>

</dd>
<dt id="&#39;buptim&#39;-=&gt;-EPOCH_NUMBER,"><a id="buptim----EPOCH_NUMBER"></a>&#39;buptim&#39; =&gt; EPOCH_NUMBER,</dt>
<dd>

<p>This value is for the document metainformation section of the prolog. It signifies the &quot;backup time&quot; of this document. If you don&#39;t stipulate a defined value here, no &#39;buptim&#39; metainformation is written.</p>

</dd>
<dt id="&#39;version&#39;-=&gt;-INTEGER,"><a id="version----INTEGER"></a>&#39;version&#39; =&gt; INTEGER,</dt>
<dd>

</dd>
<dt id="&#39;vern&#39;-=&gt;-INTEGER,"><a id="vern----INTEGER"></a>&#39;vern&#39; =&gt; INTEGER,</dt>
<dd>

</dd>
<dt id="&#39;edmins&#39;-=&gt;-INTEGER,"><a id="edmins----INTEGER"></a>&#39;edmins&#39; =&gt; INTEGER,</dt>
<dd>

</dd>
<dt id="&#39;nofpages&#39;-=&gt;-INTEGER,"><a id="nofpages----INTEGER"></a>&#39;nofpages&#39; =&gt; INTEGER,</dt>
<dd>

</dd>
<dt id="&#39;nofwords&#39;-=&gt;-INTEGER,"><a id="nofwords----INTEGER"></a>&#39;nofwords&#39; =&gt; INTEGER,</dt>
<dd>

</dd>
<dt id="&#39;nofchars&#39;-=&gt;-INTEGER,"><a id="nofchars----INTEGER"></a>&#39;nofchars&#39; =&gt; INTEGER,</dt>
<dd>

</dd>
<dt id="&#39;nofcharsws&#39;-=&gt;-INTEGER,"><a id="nofcharsws----INTEGER"></a>&#39;nofcharsws&#39; =&gt; INTEGER,</dt>
<dd>

</dd>
<dt id="&#39;id&#39;-=&gt;-INTEGER,"><a id="id----INTEGER"></a>&#39;id&#39; =&gt; INTEGER,</dt>
<dd>

<p>These are for stipulating the integer values of these various optional (and not terribly useful, for most purposes!) document metainformation items. The meanings of all of these are explained in the RTF spec.</p>

</dd>
<dt id="&#39;charset&#39;-=&gt;-STRING,"><a id="charset----STRING"></a>&#39;charset&#39; =&gt; STRING,</dt>
<dd>

<p>This is for expressing, in the prolog, RTF codename for the character set being used in this document. The default is &quot;ansi&quot;, and don&#39;t stipulate anything else (like &quot;mac&quot;, &quot;pc&quot;, or &quot;pca&quot;) unless you know what you&#39;re doing.</p>

</dd>
<dt id="&#39;rtf_version&#39;-=&gt;-INTEGER,"><a id="rtf_version----INTEGER"></a>&#39;rtf_version&#39; =&gt; INTEGER,</dt>
<dd>

<p>This is for expressing, in the prolog, what major version of RTF is being used in this document. The default is 1, and don&#39;t use anything else unless you really know what you&#39;re doing.</p>

</dd>
</dl>

</dd>
<dt id="$h-&gt;printf(&#39;format&#39;,-...items...);"><a id="h--printf-format--...items"></a>$h-&gt;printf(&#39;format&#39;, ...items...);</dt>
<dd>

<p>This is just short for $h-&gt;print(sprintf(&#39;format&#39;, ...items...)</p>

</dd>
<dt id="$h-&gt;printf(\&#39;format&#39;,-...items...);"><a id="h--printf-format--...items1"></a>$h-&gt;printf(\&#39;format&#39;, ...items...);</dt>
<dd>

<p>In this case, &#39;format&#39; is assumed to contain already-escaped RTF code. The items in ...items... are escaped as necessary, and then interpolated. I.e., this is rather like: $h-&gt;print(\sprintf &#39;format&#39;, map rtfesc($_), ...items...)) except that numeric items don&#39;t get escaped (and don&#39;t need to be). Example:</p>

<pre><code>    $h-&gt;printf(
      \&#39;{\i &quot;%s&quot;} was found in %2.2f percent of matches\par&#39;,
      $word, 100 * $count / $total
    );</code></pre>

</dd>
<dt id="$h-&gt;number_pages();"><a id="h--number_pages"></a>$h-&gt;number_pages();</dt>
<dd>

</dd>
<dt id="$h-&gt;number_pages(...);"><a id="h--number_pages1"></a>$h-&gt;number_pages(...);</dt>
<dd>

<p>This is just a handy wrapper for some code that turns on page numbering. If you call this method, you should call it right after you emit a prolog.</p>

<p>The page numbering consists of just putting the page number at the top-right of each page. If you provide items in the list (...), then that is pre-pended to the page number. Example:</p>

<pre><code>    $h-&gt;number_pages(&quot;Lexicon, p.&quot;);</code></pre>

<p>Or:</p>

<pre><code>    $h-&gt;number_pages(\&#39;\b\fs30\f2&#39;, &quot;page &quot;);</code></pre>

</dd>
<dt id="$trdecl-=-RTF::Writer::TableRowDecl-&gt;new(-...options...-)"><a id="trdecl---RTF::Writer::TableRowDecl--new--...options"></a>$trdecl = RTF::Writer::TableRowDecl-&gt;new( ...options... )</dt>
<dd>

<p>This constructs an object representing a declaration for a table row. You can have to use it in calls to $h-&gt;row($tabldecl,...), and can reuse it on subsequent calls. This object is for declaring the dimensions of table rows.</p>

<p>The work that a declaration has to do, is best explained in this diagram of a bordered three-cell table (first cell containing &quot;Foo ya!&quot;), placed near a left margin (shown as the line of colons). The things in brackets are not on the page, but just for our reference:</p>

<pre><code>  :    [..w1...]
  :            [......w2.......]
  :                            [...w3....]
  [.A..]     [.B.]           [.B.]
  :
  :    +-------+---------------+---------+
  :    |  Foo  |  Bar baz      |  Yee!   |
  :    |  ya!  |  quuxi quuxo  |         |
  :    |       |  quaqua.      |         |
  :    +-------+---------------+---------+
  :
  [.A..]     [.B.]           [.B.]
  [..r1........]
  [.....r2.....................]
  [........r3............................]</code></pre>

<p>Here the horizontal dimensions of the three-celled table are expressed in terms of: A, the distance from the current left margin; B, the minimum distance between the content of the cells (or you can think of this as twice the internal left or right borders in each cell); and then EITHER [w1, w2, w3], expressing the width of each cell, OR [r1, r2, r3], expressing each cell&#39;s right end&#39;s distance from the current left margin. All distances are, of course, in twips.</p>

<p>Options to RTF::Writer::TableRowDecl-&gt;new( ...options... ) are:</p>

<dl>

<dt id="left_start-=&gt;-TWIPS,"><a id="left_start"></a><a id="left_start---TWIPS"></a>left_start =&gt; TWIPS,</dt>
<dd>

<p>This declares the distance between the left margin, and the left end of the table. Default is 0.</p>

</dd>
<dt id="inbetween-=&gt;-TWIPS,"><a id="inbetween"></a><a id="inbetween---TWIPS"></a>inbetween =&gt; TWIPS,</dt>
<dd>

<p>This declares the distance labelled &quot;B&quot;, above. Default is 120, which is 6 points, 1/12th-inch, about 2mm.</p>

</dd>
<dt id="widths-=&gt;-[TWIPS,-TWIPS,-TWIPS,-...-],"><a id="widths"></a><a id="widths----TWIPS--TWIPS--TWIPS"></a>widths =&gt; [TWIPS, TWIPS, TWIPS, ... ],</dt>
<dd>

<p>This expresses the widths of each of the cells in this row, starting from the leftmost.</p>

</dd>
<dt id="reaches-=&gt;-[TWIPS,-TWIPS,-TWIPS,-...-],"><a id="reaches"></a><a id="reaches----TWIPS--TWIPS--TWIPS"></a>reaches =&gt; [TWIPS, TWIPS, TWIPS, ... ],</dt>
<dd>

<p>This expresses the rightmost extreme of each of the cells in this row.</p>

</dd>
<dt id="align-=&gt;-alignmentspecs,"><a id="align"></a><a id="align---alignmentspecs"></a>align =&gt; <i>alignmentspecs</i>,</dt>
<dd>

<p>This is explained in detail in the <a href="./RTF::Writer.html#Cell-Alignment-Syntax">section &quot;Cell Alignment Syntax&quot;, below.</a></p>

</dd>
<dt id="borders-=&gt;-borderspecs,"><a id="borders"></a><a id="borders---borderspecs"></a>borders =&gt; <i>borderspecs</i>,</dt>
<dd>

<p>This is explained in detail in the <a href="./RTF::Writer.html#Cell-Border-Syntax">section &quot;Cell Border Syntax&quot;, below.</a></p>

</dd>
</dl>

</dd>
<dt id="$h-&gt;paragraph(...);"><a id="h--paragraph"></a>$h-&gt;paragraph(...);</dt>
<dd>

<p>This makes the items in the list (...) into a paragraph. Basically just a wrapper for $h-&gt;print([ \&#39;{\par&#39;, ..., \&#39;\pard}&#39;, ])</p>

</dd>
<dt id="$h-&gt;row($trdecl,-...items...);"><a id="h--row-trdecl--...items"></a>$h-&gt;row($trdecl, ...items...);</dt>
<dd>

<p>This emits a table row, with dimensions as stipulated by the $trdecl object, and with row content from the items given.</p>

<p>You must provide a value for $trdecl, or a fatal error results.</p>

<p>If you provide <i>fewer</i> items than $trdecl declares cells, then you get empty cells to fill out the row. If you provide <i>more</i> items than $trdecl declares cells, then the width of the last declared row is used in figuring the width of the additional cells for this row.</p>

<p>Example:</p>

<pre><code>    my $decl = RTF::Writer::TableRowDecl-&gt;new(&#39;widths&#39; =&gt; [1500,1900]);
    $h-&gt;row($decl, &quot;Stuff&quot;, &quot;Hmmm&quot;);
    $h-&gt;row($decl, [\&#39;\ul&#39;, &#39;Foo&#39;], &#39;Bar&#39;, \&#39;\bullet&#39;);
    $h-&gt;row($decl, &quot;Hooboy.&quot;);</code></pre>

<p>This creates a table resembing:</p>

<pre><code>    +-------------+-------------------+
    | Stuff       | Hmm               |
    +-------------+-------------------+-------------------+
    | _Foo_       | Bar               | *                 |
    +-------------+-------------------+-------------------+
    | &quot;Hooboy.&quot;   |                   |
    +-------------+-------------------+</code></pre>

<p>Note that you <i>MUST NOT</i> use &#39;\par&#39; commands in any items you emit in row cells!</p>

<p>The $h-&gt;row(...) method is a wrapper for producing elementary tables in RTF, with the minimum of parameters; the myriad other options that tables can have (for example, changing borders) are not supported. If you really need to generate tables fancier than what $h-&gt;row(...) can produce, start off reading the RTF spec, reading the source for row() (and the RTF::Writer::TableRowDecl class), and progress from there. Note that MSWord has been known to crash when given malformed RTF table code.</p>

</dd>
<dt id="$h-&gt;table($trdecl,-[...row1-items...],-[...row2-items...],-...-);"><a id="h--table-trdecl---...row1-items...---...row2-items"></a>$h-&gt;table($trdecl, [...row1 items...], [...row2 items...], ... );</dt>
<dd>

</dd>
<dt id="$h-&gt;table([...row1-items...],-[...row2-items...],-...-);"><a id="h--table-...row1-items...---...row2-items"></a>$h-&gt;table([...row1 items...], [...row2 items...], ... );</dt>
<dd>

<p>This is a wrapper around $h-&gt;row. It takes a list of arrayrefs, which are fed to calls to h-&gt;row($tr_decl, @$each_arrayref). You should provide a $trdecl, but if you don&#39;t, then one is <i>crudely</i> guessed at, based on the maximum number of columns in all rows.</p>

</dd>
<dt id="$h-&gt;image(-image_parameters-)"><a id="h--image--image_parameters"></a>$h-&gt;image( <i>image_parameters</i> )</dt>
<dd>

<p>This returns a scalar-reference to RTF-code representing the given image with given parameters. For example:</p>

<pre><code>  $h-&gt;paragraph(
    &quot;See here: &quot;,
    $h-&gt;image( &#39;filename&#39; =&gt; &quot;foo.png&quot;, ),
  );</code></pre>

<p>The legal options are explained below:</p>

<dl>

<dt id="filename-=&gt;-FILENAME,"><a id="filename"></a><a id="filename---FILENAME"></a>filename =&gt; FILENAME,</dt>
<dd>

<p>This should be the path to a readable filename. You have to specify this. If you don&#39;t specify this, or if the value isn&#39;t a readable file, then a fatal error results. Currently, only JPEGs and PNGs are allowed; specifying any other kind of file causes a fatal error.</p>

<p>(The <code>filename</code> option above is required, but the following options are all generally optional -- altho some RTF processors may be finicky if you set some of the following but not others, for no apparent reason. When in doubt, test.)</p>

</dd>
<dt id="wgoal-=&gt;-TWIPS,"><a id="wgoal"></a><a id="wgoal---TWIPS"></a>wgoal =&gt; TWIPS,</dt>
<dd>

<p>The desired width of the image</p>

</dd>
<dt id="hgoal-=&gt;-TWIPS,"><a id="hgoal"></a><a id="hgoal---TWIPS"></a>hgoal =&gt; TWIPS,</dt>
<dd>

<p>The desired height of the image</p>

</dd>
<dt id="scalex-=&gt;-PERCENT,"><a id="scalex"></a><a id="scalex---PERCENT"></a>scalex =&gt; PERCENT,</dt>
<dd>

</dd>
<dt id="scaley-=&gt;-PERCENT,"><a id="scaley"></a><a id="scaley---PERCENT"></a>scaley =&gt; PERCENT,</dt>
<dd>

<p>Respectively, the horizontal (X) or vertical (Y) scaling value. The argument is an integer representing a percentage. (The default is 100 percent)</p>

</dd>
<dt id="cropt-=&gt;-TWIPS,"><a id="cropt"></a><a id="cropt---TWIPS"></a>cropt =&gt; TWIPS,</dt>
<dd>

</dd>
<dt id="cropb-=&gt;-TWIPS,"><a id="cropb"></a><a id="cropb---TWIPS"></a>cropb =&gt; TWIPS,</dt>
<dd>

</dd>
<dt id="cropl-=&gt;-TWIPS,"><a id="cropl"></a><a id="cropl---TWIPS"></a>cropl =&gt; TWIPS,</dt>
<dd>

</dd>
<dt id="cropr-=&gt;-TWIPS,"><a id="cropr"></a><a id="cropr---TWIPS"></a>cropr =&gt; TWIPS,</dt>
<dd>

<p>These specify the top, bottom, left, and right cropping values. A positive value crops <i>toward</i> the center of the image. A negative value crops <i>away</i> from the center, adding a padding space around the image.</p>

<p>(The default is to do neither, as you&#39;d get from a cropping value of 0.)</p>

</dd>
<dt id="picspecs-=&gt;-\SCALARVALUE,"><a id="picspecs"></a><a id="picspecs----SCALARVALUE"></a>picspecs =&gt; \SCALARVALUE,</dt>
<dd>

<p>This overrides generation of the normal image values based the image and the above parameters, and instead uses whatever value you pass a reference to. You normally shouldn&#39;t need to use this.</p>

</dd>
</dl>

</dd>
<dt id="$h-&gt;image_paragraph(-image_parameters-);"><a id="h--image_paragraph--image_parameters"></a>$h-&gt;image_paragraph( <i>image_parameters</i> );</dt>
<dd>

<p>This take the same options as <code>$h-&gt;image(...)</code>, but has three differences: First, it is a shortcut for this:</p>

<pre><code>   $h-&gt;paragraph( \&#39;\qc&#39;,
     $h-&gt;image( ...params...),
   );</code></pre>

<p>Secondly, whereas <code>$h-&gt;image(...)</code> returns the image data (as an RTF scalarref), <code>$h-&gt;image_paragraph(...)</code> doesn&#39;t return much of anything.</p>

<p>Thirdly, <code>$h-&gt;image_paragraph(...)</code> is often much more memory-efficient, since it can write the image data to a file as it&#39;s RTF-ified, instead of building it all up in memory.</p>

</dd>
<dt id="$h-&gt;close();"><a id="h--close"></a>$h-&gt;close();</dt>
<dd>

<p>This completes writing to the stream denoted by the object in <code>$h</code>; this generally (assuming you&#39;d called $h-&gt;prolog) involves just writing a final close-brace to $h, and then closing whatever filehandle or file $h writes to (unless we&#39;re writing to a string, in which case we just discard $h&#39;s reference to it). After you call <code>$h-&gt;close</code>, you should not call any other methods with <code>$h</code>!</p>

<p>Note that you don&#39;t <i>have</i> to explicitly call <code>$h-&gt;close</code> -- when an unclosed RTF::Writer object goes out of scope (or, more precisely speaking, when if its refcount hits zero), then something equivalent to calling <code>$h-&gt;close</code> is done automatically for you.</p>

</dd>
</dl>

<h1 id="AUTOMETHODS">AUTOMETHODS</h1>

<p>In addition to any of the above methods, you can use any RTF command (and optional integer arguments) as a valid method name, by just capitalizing its first letter, as shown below:</p>

<dl>

<dt id="$h-&gt;Foo();"><a id="h--Foo"></a>$h-&gt;Foo();</dt>
<dd>

<p>The same as $h-&gt;print( \&#39;\foo&#39; );</p>

<p>For example, $h-&gt;Page() is the same as $h-&gt;print(\&#39;\page&#39;)</p>

</dd>
<dt id="$h-&gt;Foo(...);"><a id="h--Foo1"></a>$h-&gt;Foo(...);</dt>
<dd>

<p>(Where &quot;...&quot; is a non-empty list.)</p>

<p>The same as $h-&gt;print( [ \&#39;\foo&#39;, ... ] );</p>

<p>For example: <code>$h-&gt;I(&#39;stuff&#39;)</code> is the same as $h-&gt;print([\&#39;\i&#39;, &#39;stuff&#39;])</p>

</dd>
<dt id="$h-&gt;Foo123();"><a id="h--Foo123"></a>$h-&gt;Foo123();</dt>
<dd>

<p>The same as $h-&gt;print( \&#39;\foo123&#39; ). I.e., command word &quot;\foo&quot; with an integer argument of 123.</p>

<p>For example: $h-&gt;Cols2() is the same as $h-&gt;print(\&#39;\cols2&#39;)</p>

</dd>
<dt id="$h-&gt;Foo123(...);"><a id="h--Foo1231"></a>$h-&gt;Foo123(...);</dt>
<dd>

<p>(Where &quot;...&quot; is a non-empty list.)</p>

<p>The same as $h-&gt;print( [ \&#39;\foo123&#39;, ... ] );</p>

<p>For example: $h-&gt;F2(&#39;stuff&#39;) is the same as $h-&gt;print([\&#39;\f2&#39;, &#39;stuff&#39;]).</p>

</dd>
<dt id="$h-&gt;Foo_123();"><a id="h--Foo_123"></a>$h-&gt;Foo_123();</dt>
<dd>

<p>The same as $h-&gt;print( \&#39;\foo-123&#39; );, i.e., command word &quot;\foo&quot; with an integer argument of negative 123. (You can&#39;t have a &quot;-&quot; in a method name, so I use an underscore instead.)</p>

<p>For example: $h-&gt;Li_1440() is the same as $h-&gt;print([\&#39;\li-1440&#39;, &#39;stuff&#39;])</p>

</dd>
<dt id="$h-&gt;Foo_123(...);"><a id="h--Foo_1231"></a>$h-&gt;Foo_123(...);</dt>
<dd>

<p>(Where &quot;...&quot; is a non-empty list.)</p>

<p>The same as $h-&gt;print( [ \&#39;\foo-123&#39;, ... ] );</p>

</dd>
</dl>

<h1 id="FUNCTIONS">FUNCTIONS</h1>

<p>None of these functions are exported by default, but they can be exported on request, as in:</p>

<pre><code>  use RTF::Writer qw(inches cm rtfesc);</code></pre>

<dl>

<dt id="inch($x),-inches($x),-in($x)"><a id="inch"></a><a id="inch-x--inches-x--in-x"></a>inch($x), inches($x), in($x)</dt>
<dd>

<p>These synonymous functions all construe the numeric value in $x as inches, and return the equivalent number of twips. For example, <code>inches(1.5)</code> returns 2160, because an inch and a half is exactly 2160 twips. The return value of these functions is always an integer, as fractions of twips are not used in RTF.</p>

</dd>
<dt id="point($x),-points($x),-pt($x)"><a id="point"></a><a id="point-x--points-x--pt-x"></a>point($x), points($x), pt($x)</dt>
<dd>

<p>These synonymous functions all construe the numeric value in $x as points, and return the equivalent number of twips. For example, <code>points(54)</code> returns 1080, because fifty-four points is exactly 1080 twips. The return value of these functions is always an integer, as fractions of twips are not used in RTF.</p>

</dd>
<dt id="cm(x)"><a id="cm"></a><a id="cm-x"></a>cm(x)</dt>
<dd>

<p>This function construes the numeric value in $x as centimeters, and returns the equivalent number of twips. For example, <code>cm(1.5)</code> returns 850, because 1.5cm is approximately 850 twips (i.e., it&#39;s 850, when rounded to the nearest whole number). Since twips and points are both are defined in terms of inches (1440 twips = 72 points = 1 inch), conversion between cm and these other units is approximate.</p>

<p>The return value of <code>cm($x)</code> is always an integer, as fractions of twips are not used in RTF.</p>

</dd>
<dt id="rtfesc($text);-#-void-context"><a id="rtfesc"></a><a id="rtfesc-text----void-context"></a>rtfesc($text); # void context</dt>
<dd>

</dd>
<dt id="rtfesc($x,-$y);-#-void-context"><a id="rtfesc1"></a><a id="rtfesc-x---y----void-context"></a>rtfesc($x, $y); # void context</dt>
<dd>

</dd>
<dt id="rtfesc(@z);-#-void-context"><a id="rtfesc2"></a><a id="rtfesc-z----void-context"></a>rtfesc(@z); # void context</dt>
<dd>

</dd>
<dt id="$escaped-=-rtfesc($x);"><a id="escaped---rtfesc-x"></a>$escaped = rtfesc($x);</dt>
<dd>

</dd>
<dt id="@escaped-=-rtfesc($x,-$y,-...);"><a id="escaped---rtfesc-x---y"></a>@escaped = rtfesc($x, $y, ...);</dt>
<dd>

<p>This escapes some plaintext so it&#39;s good RTF. E.g., it turns &quot;Foo\nBar\\&quot; into &quot;Foo\n\\line Bar\\&#39;5c&quot; (since a plaintext backslash needs to be escaped in RTF, and a &quot;\n&quot;&#39;s RTF equivalent is the &#39;\line&#39; command).</p>

<p>In void context (i.e., where you aren&#39;t capturing the return value), this in-place alters the values you pass it.</p>

<p>In scalar or list context, doesn&#39;t alter the original(s), but returns an escaped copy of what you pass in.</p>

</dd>
</dl>

<h2 id="Cell-Alignment-Syntax"><a id="Cell"></a>Cell Alignment Syntax</h2>

<p>To control alignment of cells, specify <code>align =&gt; &quot;<i>direction direction direction...</i>&quot;</code>, where each direction is one of these alphametic strings for the given directions (based on the abbreviated English names for map directions and canvas directions):</p>

<pre><code>    NW  N  NE        TL  T  TR
      \ | /            \ | /
    W - C - E        L - C - R
      / | \            / | \
    SW  S  SE        BL  B  BR</code></pre>

<p>For example, <code>align =&gt; &quot;nw c&quot;</code> means that the first cell will be aligned to the <b><i>n</i></b>orth<b><i>w</i></b>est (a.k.a. the <b><i>t</i></b>op-<b><i>l</i></b>eft), and that the second cell (and any cells thereafter) will be aligned to the <b><i>c</i></b>enter.</p>

<p>An acceptable alternate syntax is to <code>align =&gt; [&#39;nw&#39;, &#39;c&#39;]</code> -- i.e., to pass a reference to an array of <i>&#39;direction&#39;</i> items, instead of just passing a single scalar of whitespace-padded directions.</p>

<p>(Note that alignment syntax and cell border syntax, may look a bit alike, but are really very different; try not to mix them up.)</p>

<h2 id="Cell-Border-Syntax"><a id="Cell1"></a>Cell Border Syntax</h2>

<p>To specify what borders occur on cells, use one of the following syntaxes:</p>

<dl>

<dt id="borders-=&gt;-1,-or-borders-=&gt;-&#39;all&#39;,-to-turn-on-a-simple-border-for-all-sides-of-all-cells.-This-is-the-default-so-if-you-don&#39;t-specify-a-borders-=&gt;-something-option,-it-will-be-as-if-you-specified-borders-=&gt;-1."><a id="borders1"></a><a id="borders---1--or-borders----all--to-turn-on-a-simple-border-for-all-sides-of-all-cells.-This-is-the-default-so-if-you-don-t-specify-a-borders---something-option--it-will-be-as-if-you-specified-borders---1"></a><code>borders =&gt; 1,</code> or <code>borders =&gt; &#39;all&#39;,</code> to turn on a simple border for all sides of all cells. <b>This is the default --</b> so if you don&#39;t specify a <code>borders =&gt; <i>something</i></code> option, it will be as if you specified <code>borders =&gt; 1</code>.</dt>
<dd>

</dd>
<dt id="borders-=&gt;-0,-or-borders-=&gt;-&#39;none&#39;,-to-turn-off-all-borders-for-all-cells.-In-previous-versions-of-RTF::Writer,-this-was-the-default."><a id="borders2"></a><a id="borders---0--or-borders----none--to-turn-off-all-borders-for-all-cells.-In-previous-versions-of-RTF::Writer--this-was-the-default"></a><code>borders =&gt; 0,</code> or <code>borders =&gt; &#39;none&#39;,</code> to turn off all borders for all cells. <b>In previous versions of RTF::Writer, this <i>was</i> the default.</b></dt>
<dd>

</dd>
</dl>

<p>or use this complex syntax for finer control:</p>

<dl>

<dt id="borders-=&gt;-[-cellborders,-cellborders,-...-],"><a id="borders3"></a><a id="borders-----cellborders--cellborders"></a><code>borders =&gt; [ <i>cellborders, cellborders, ...</i> ],</code></dt>
<dd>

</dd>
</dl>

<p>...where each <code>cellborders</code> is a string in the form &quot;<i>border border border</i>&quot;, where, in turn, each <i>border</i> is a substring in the form <i>&quot;direction-thickness-type&quot;,</i> <i>&quot;direction-type&quot;</i> <i>&quot;direction-thickness&quot;,</i> or <i>&quot;direction&quot;.</i> Alternately, <code>cellborders</code> can be one of these shorter values:</p>

<dl>

<dt id="the-value-&quot;none&quot;-meaning-no-borders-in-any-direction"><a id="the"></a><a id="the-value--none--meaning-no-borders-in-any-direction"></a>the value &quot;none&quot; -- meaning no borders in any direction</dt>
<dd>

</dd>
<dt id="an-integer-between-2-and-75-meaning-a-simple-border-that&#39;s-that-many-twips-thick,-on-all-sides.-(So-specifying-&quot;22&quot;-is-synonymous-with-&quot;all-22-s&quot;-in-the-longer-syntax.)"><a id="an1"></a><a id="an-integer-between-2-and-75-meaning-a-simple-border-that-s-that-many-twips-thick--on-all-sides.--So-specifying--22--is-synonymous-with--all-22-s--in-the-longer-syntax"></a>an integer between 2 and 75 -- meaning a simple border that&#39;s that many twips thick, on all sides. (So specifying &quot;22&quot; is synonymous with &quot;all-22-s&quot; in the longer syntax.)</dt>
<dd>

</dd>
<dt id="empty-string-or-undef-meaning-a-simple-border-of-the-default-thickness-on-all-sides.-(So-specifying-&quot;&quot;-is-synonymous-with-&quot;all&quot;,-which-is-in-turn-synonymous-with-&quot;nsew-15-s&quot;.)"><a id="empty"></a><a id="empty-string-or-undef-meaning-a-simple-border-of-the-default-thickness-on-all-sides.--So-specifying---is-synonymous-with--all--which-is-in-turn-synonymous-with--nsew-15-s"></a>empty-string or undef -- meaning a simple border of the default thickness on all sides. (So specifying &quot;&quot; is synonymous with &quot;all&quot;, which is in turn synonymous with &quot;nsew-15-s&quot;.)</dt>
<dd>

</dd>
</dl>

<p><i>direction</i> is either &quot;all&quot;, or a combination of some of the uppercase or lowercase letters N, S, E, W, T, B, R, L. (Of course, the first four are synonymous with the other four, respectively.)</p>

<p><i>thickness</i> (by default, 15) is an integer between 1 and 75, specifying the thickness of the border, in twips.</p>

<p>And <i>type</i> (by default, &quot;s&quot;) is one of these, as specified in the RTF spec:</p>

<pre><code>           s : Single-thickness border
          th : Double-thickness border
          sh : Shadowed border
          db : Double border
         dot : Dotted border
        hair : Hairline border

        dash : Dashed border
       inset : Inset border
      dashsm : Dashed border (small)
       dashd : Dot-dashed border
      dashdd : Dot-dot-dashed border
      outset : Outset border
      triple : Triple border
      tnthsg : Thick-thin border (small)
      thtnsg : Thin-thick border (small)
    tnthtnsg : Thin-thick thin border (small)
      tnthmg : Thick-thin border (medium)
      thtnmg : Thin-thick border (medium)
    tnthtnmg : Thin-thick thin border (medium)
      tnthlg : Thick-thin border (large)
      thtnlg : Thin-thick border (large)
    tnthtnlg : Thin-thick-thin border (large)
        wavy : Wavy border
      wavydb : Double wavy border
  dashdotstr : Striped border
      emboss : Embossed border
     engrave : Engraved border
       frame : Border resembles a &quot;frame&quot;</code></pre>

<p>Not all of the above are supported by all RTF readers. If you&#39;re concerned about portability, consider sticking to the core set of just the first six listed above.</p>

<p>Also, the syntax <code>borders =&gt; cellspec</code> is accepted as a synonym for <code>borders =&gt; [cellspec]</code>, for when you&#39;re specifying just a single cellspec, for use the the first and all subsequent cells.</p>

<p>Cell border syntax is best shown by example:</p>

<pre><code>  borders=&gt; [ &quot;ns-30-db w-25&quot;, &quot;all-10-wavy&quot;, &quot;none&quot;, 13 ],</code></pre>

<p>That means to that the first cell should have a 30-twip-thick double border on the top and bottom (north and south) and a 25-twip-thick single border on the west (and no border on the east side); the second cell should have a 10-twip-thick wavy border on all sides; the third cell should have no borders on any sides; and the fourth (and any additional) cells should have a 13-twip-thick single border on all sides.</p>

<p>Incidentally, when a particular <i>cellspec</i> contains apparently contradictory declarations, the last one is the one that has an effect. For example, consider <span style="white-space: nowrap;"><code>&quot;all-20-db w-10-s&quot;</code></span> -- the first part turns on 20-twip double borders on all sides, and the second part turns on a 10-twip single border on the west side. Since the second part is last, that&#39;s the one that has an effect -- so just the north, south, and east sides actually get a 20-twip double border, and the west side gets the 10-twip single border.</p>

<p>(This means that if you say <span style="white-space: nowrap;"><code>&quot;w-10-s all-20-db&quot;</code></span>, the first part will have no effect, because the second part will override the west-side declaration.)</p>

<h2 id="Cell-Border-Syntax,-Formally"><a id="Cell2"></a><a id="Cell-Border-Syntax--Formally"></a>Cell Border Syntax, Formally</h2>

<p>If you&#39;d prefer a more formal grammar for this all, this should help:</p>

<pre><code>    borderdec := 
       &#39;borders&#39; =&gt;  &#39;0&#39;    # no borders at all
                   | &#39;1&#39;    # same as [&quot;all-15-s&quot;]
                   | [ cellspec, cellspec, ... ]
                   | cellspec   # default for one-cell form of the above

    cellspec :=  &quot;&quot; | undef    # same as &quot;all-15-s&quot;
                 | int         # same as &quot;all-INT-s&quot; (note: 2 &lt;= int &lt;= 75)
                 | &quot;none&quot;      # no borders on this cell
                 | (border ( &#39;, &#39; . border )* )
                      # a list of border expressions separated by
                      # a comma (and/or whitespace, in fact)

    border    := direction-thickness-type # For example, &quot;nse-15-s&quot;
                 | direction-type         #  same as &quot;DIR-15-TYPE&quot;
                 | direction-thickness    #  same as &quot;DIR-THICK-s&quot;
                 | direction              #  same as &quot;DIR-15-s&quot;

    direction := &quot;all&quot; | qr/^[nsewtblrNSEWTBLR]+$/
       # Note that &quot;nw&quot; doesn&#39;t mean the direction northwest, but
       # simultaneously the north and west sides.
    
    thickness := integer in the range 1 - 75
    
    type  :=  &quot;s&quot; | &quot;th&quot; | &quot;sh&quot; | &quot;db&quot; | &quot;dot&quot; | &quot;hair&quot; | (etc)</code></pre>

<h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1>

<p><a href="https://metacpan.org/pod/RTF::Cookbook">RTF::Cookbook</a></p>

<p>The book <i>RTF Pocket Guide</i> from O&#39;Reilly. <a href="http://www.oreilly.com/catalog/rtfpg/">http://www.oreilly.com/catalog/rtfpg/</a></p>

<h1 id="COPYRIGHT-AND-DISCLAIMER"><a id="COPYRIGHT"></a>COPYRIGHT AND DISCLAIMER</h1>

<p>Copyright 2001,2,3 Sean M. Burke.</p>

<p>This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p>

<p>This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.</p>

<p>The author of this document is not affiliated with the Microsoft corporation.</p>

<p>Product and company names mentioned in this document may be the trademarks or service marks of their respective owners. Trademarks and service marks are not identified, although this must not be construed as the author&#39;s expression of validity or invalidity of each trademark or service mark.</p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Sean M. Burke, &lt;sburke@cpan.org&gt;</p></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install RTF::Writer, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm RTF::Writer</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install RTF::Writer</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="./RTF::Writer.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
